package service

import (
	"context"
	"devops-super/api"
	v1 "devops-super/api/alerts/v1"
	"devops-super/internal/model/entity"
	"devops-super/internal/model/mymodel"
)

// IAlertPeople 告警人员服务接口
type IAlertPeople interface {
	// Add 添加告警人员
	Add(ctx context.Context, in *entity.AlertPeople) (err error)

	// Upt 更新告警人员
	Upt(ctx context.Context, in *entity.AlertPeople) (err error)

	// GetPageLst 分页获取告警人员列表
	GetPageLst(ctx context.Context, req *v1.AlertPeopleGetPageLstReq) (out *api.PageLstRes[*mymodel.AlertPeopleResponse], err error)

	// UptStatus 更新告警人员状态
	UptStatus(ctx context.Context, id int, status int) (err error)

	// Del 删除告警人员
	Del(ctx context.Context, id int) (err error)

	// GetOne 获取一条告警人员信息
	GetOne(ctx context.Context, id int) (out *entity.AlertPeople, err error)

	// GetOptions 获取表单告警人员选项
	GetOptions(ctx context.Context, in *v1.AlertPeopleGetOptionsReq) (out *v1.AlertPeopleGetOptionsRes, err error)
}

var (
	localAlertPeople IAlertPeople
)

func AlertPeople() IAlertPeople {
	if localAlertPeople == nil {
		panic("implement not found for interface IAlertPeople, forgot register?")
	}
	return localAlertPeople
}

func RegisterAlertPeople(i IAlertPeople) {
	localAlertPeople = i
}